package com.framework.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;
import java.util.Random;
import java.util.UUID;

public class UuidUtil
{

	private static Logger logger = LoggerFactory.getLogger(UuidUtil.class);

	/**
	 * 得到随机数
	 * @return
	 */
	public static long getRndNumCode()
	{
		Random rand = new Random();
		Date now = new Date();
		long t = now.getTime();
		return Long.valueOf(t * 1000L + (long)rand.nextInt(1000));
	}
	public static String get32UUID()
	{
		String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
		return uuid;
	}

	public static void main(String[] args)
	{
		logger.debug(get32UUID());
	}
}
